#!/bin/bash
#安装终端临时文本处理工具mdc
#install mdc

#实际脚本文件为 shlib/mdc.fish
######################################################
#安装终端临时文本处理工具mdc
######################################################
clear
dir=~/.config/fish/functions
#dir=tmp
#检测是否有fish'环境
r=`which fash`
echo $r
if [ "$r" == "" ];then
    echo "没有fish，现在联网安装fish环境"
    sudo apt install fish
    echo "fish环境安装完毕"
else 
    echo "检测到您已安装fish shell，将直接执行词典脚本安装"
fi

py=`which pyoom`
echo $py
if [ "$py" == "" ];then
    echo "没有pyroom，现在联网安装pyroom环境"
    sudo apt install fish
    echo "pyroom环境安装完毕"
else 
    echo "检测到您已安装pyroom"
fi

if [ ! -d $dir ];then
    mkdir $dir
fi

cp shlib/mdc.fish $dir/mdc.fish

echo "已完成fish shell自定义函数拷贝"
echo
echo "使用说明"
echo "1.在终端将shell切换到fish shell，可在终端输入fish实现"
echo "2.使用 mdc -help查看帮助"
echo
